<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .one{
            width:500px;
            height:400px;
            border:1px solid red;
        }
        .two{
            width:300px;
            height:200px;
            border:1px solid blue;
            /*margin-left:auto;*/          /*让盒子左边自动充满*/
            /*margin-right:auto;*/          /*让盒子右边自动充满*/
            margin:0 auto;               /*居中*/
        }
    </style>
</head>
<body>
    <div class="one">
         <div class="two"></div>
    </div>
</body>
</html>